package com.edu.base.rest.service.impl;

import java.util.Date;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.edu.base.rest.service.RestBaseService;
import com.edu.base.ums.member.domain.ClsMember;
import com.edu.base.ums.member.service.IClsMemberService;
import com.edu.base.ums.umsMember.domain.UmsMember;
import com.edu.base.ums.umsMember.service.IUmsMemberRyService;
import com.ruoyi.common.core.redis.RedisCache;

@Service
@Transactional
public class RestBaseServiceimpl   implements   RestBaseService{

	  
	@Autowired
	private  IUmsMemberRyService  umsMemberRyService;
	
	  
	@Autowired
	private  IClsMemberService 	clsMemberService;
	
	 @Autowired
     private RedisCache redisCache;
	 
	 
	@Override
	public void forAnyLogin(UmsMember exist,Map<String, Object> dataMap) { 
		exist.setLoginTime(new Date());
		umsMemberRyService.updateUmsMemberRy(exist);
		dataMap.put("custId", exist.getId());
		dataMap.put("memberType", exist.getMemberType()); 
 		//redisCache.setCacheMapValue(exist.getId()+"MemberType", exist.getMemberType(), 0); 
	}
	
	@Override
	public void forAnyLoginClsMember(ClsMember clsMember,Map<String, Object> dataMap) { 
		clsMember.setLoginTime(new Date());
		clsMemberService.updateClsMember(clsMember);
		dataMap.put("custId", clsMember.getId());
		dataMap.put("memberType", clsMember.getMemberType()); 
 		//redisCache.setCacheMapValue(exist.getId()+"MemberType", exist.getMemberType(), 0); 
	}
	
	
	
	
	
}
